package com.zz.parkingsystem.controller.user;

import com.zz.parkingsystem.service.ParkingService;
import com.zz.parkingsystem.util.Result;
import com.zz.parkingsystem.util.ResultGenerator;
import com.zz.parkingsystem.vo.ParkingVO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/parking")
@Api(value = "",tags = "收费策略接口")
public class ParkingController {
    @Autowired
    private ParkingService parkingService;
    //通过泊位号，查询泊位，还有路段,收费策略,封装成一个parkingVO返回
    @GetMapping("selParkingAndByPkNo/{pkNo}")
    public Result selParkingAndByPkNo(@PathVariable("pkNo") String pkNo){
        ParkingVO parkingVO = parkingService.selParkingVOByPkNo(pkNo);
        return ResultGenerator.genSuccessResult(parkingVO);
    }
}
